from Base import message, intersect, SS_VALID
from DRG import MDCE_DRG

def group(record):
  adrg_zd = []
  adrg_zd1 = []
  adrg_ss = ["39.7902","31.1x00x005","31.9400","33.9200","34.7300x001","38.7x04","39.7900x030","86.3x02","86.3x03","86.3x10x067","86.3x12","96.0500x001","96.5602","99.1007"]
  adrg_ss1 = []
  dept_list = []

  if True and record.ssList and record.ssList[0] in adrg_ss:
    message('符合EJ1入组条件，匹配规则：主手术匹配')

    if MDCE_DRG.EJ11_group(record):
      return 'EJ11'

    if MDCE_DRG.EJ13_group(record):
      return 'EJ13'

    if MDCE_DRG.EJ15_group(record):
      return 'EJ15'
        
    return 'EJ1'
  else:
    return ''
    
